var http = require("http");
var util = require('util');
var url = require("url");

function start() {
	function onRequest(request, response) {
		var pathname = url.parse(request.url).pathname;
		util.puts("> Request for " + pathname + " received.");
		route(pathname);
		response.writeHead(200, {"Content-Type": "text/plain"});
		response.write("Hello World");
		response.end();
	}
	http.createServer(onRequest).listen(7777);
	util.puts('> Started server on port 7777');
}

function route(pathname) {
	console.log("> About to route a request for " + pathname);
}